﻿/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

grammar expp;


//src expr:expr token atom|atom
//dest expr:atom (token expr)?
//       
expr : expr_add|expr_mul|expr_other;
expr_group :  ('(' SPACE* expr SPACE*')' );
//
//
expr_add : (expr_atom|expr_mul) (SPACE* token_add SPACE*expr_add)?;
expr_mul : expr_atom (SPACE* token_mul SPACE*expr_mul)?;
expr_other:'func()';
//
token_mul:'*'|'/';
token_add : '+'|'-';
expr_atom:INT|expr_group|expr_other;

SPACE: ' ';
NEWLINE : [\r\n]+ ;
INT     : [0-9]+ ; 